﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>岗位管理</title>
    <include file="../inc/meta.inc" />

</head>

<body>
    <div id="app" v-cloak>
        <div class="toolsbar">
            <btngroup show="新增,修改,删除" ref='btngroup' @delete="deleteData" path="PositionModify" width="600" height="400"
                :selects='selects' idkey='Posi_Id'></btngroup>
        </div>
        <template>
            <el-table ref="datatable" :data="datas" tooltip-effect="dark" style="width: 100%"
                @selection-change="val=>selects=val" @row-dblclick="rowdblclick" row-key="Posi_Id" index-key="Posi_Tax"
                :row-class-name="data=>{return data.row.Posi_IsUse ? 'enable' : 'disabled';}">
                <el-table-column type="selection" width="55">
                </el-table-column>
                <el-table-column type="index" width="50">
                </el-table-column>
                <el-table-column label="岗位名称">
                    <template slot-scope="scope">
                        <span v-html='scope.row.Posi_Name' class="draghandle large" ></span>
                        <span class="el-icon-s-custom red" v-show='scope.row.Posi_IsAdmin' title="系统管理岗"></span>
                    </template>
                </el-table-column>
                <el-table-column label="启用" width="80" align="center">
                    <template slot-scope="scope">
                        <span class="el-icon-loading" v-show="loadingid==scope.row.Posi_Id"></span>
                        <el-switch v-model="scope.row.Posi_IsUse" @change="changeUse(scope.row)"
                            v-show="loadingid!=scope.row.Posi_Id">
                        </el-switch>
                    </template>
                </el-table-column>
                <el-table-column label="成员" width="80" align="center">
                    <template slot-scope="scope">
                        <el-link type="primary" plain @click="$refs.btngroup.pagebox('PositionMember?id='+scope.row.Posi_Id,
                    '“'+scope.row.Posi_Name+'”的成员设置',
                    'Posi_'+scope.row.Posi_Id,640,480)">设置成员</el-link>
                    </template>
                </el-table-column>
                <el-table-column label="权限" width="60" align="center" v-if="false">
                    <template slot-scope="scope">
                        <el-link type="primary" plain @click="$refs.btngroup.pagebox('Purview?type=posi&id='+scope.row.Posi_Id,
                                 '“'+scope.row.Posi_Name+'”的权限设置',
                                 'Posi_'+scope.row.Posi_Id,600,380)">权限</el-link>
                    </template>
                </el-table-column>
                <el-table-column label="操作" show-overflow-tooltip width="120">
                    <template slot-scope="scope">
                        <span class="el-icon-loading" v-show="loadingid==scope.row.Posi_Id"></span>
                        <el-button-group v-show="loadingid!=scope.row.Posi_Id">
                            <el-link type="primary" plain icon="el-icon-edit"
                                @click='$refs.btngroup.modify(scope.row.Posi_Id)'>修改</el-link>
                            <el-tooltip class="item" effect="dark" :content="scope.row.Posi_IsAdmin ? '系统岗位，不得删除' : ''"
                                :disabled='!scope.row.Posi_IsAdmin' placement="left">
                                <el-link type="danger" plain icon="el-icon-delete" :disabled='scope.row.Posi_IsAdmin'
                                    @click='$refs.btngroup.delete(scope.row.Posi_Id,{})'>删除</el-link>
                            </el-tooltip>

                        </el-button-group>
                    </template>
                </el-table-column>
            </el-table>

        </template>

    </div>
</body>

</html>